<!doctype html>
<html  class="x-admin-sm">
<head>
	{include file="public/header"}
  <link rel="stylesheet" href="/static/manager/css/login.css">
</head>
<body class="login-bg">
    
    <div class="login layui-anim layui-anim-up">
        <div class="message">后台管理登录</div>
        <div id="darkbannerwrap"></div>
        
        <form method="post" class="layui-form" >
            <input name="name" placeholder="用户名"  type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="button">
            <hr class="hr20" >
        </form>
    </div>

    <script>
        $(function  () {
            layui.use('form', function(){
              var form = layui.form;
              form.on('submit(login)', function(data){
                  $.ajax({
                      url: "{:url('account/login')}",
                      data: data.field,
                      type: 'post',
                      dataType: "json",
                      async: false,
                      success: function (response) {
                          if (response.code == '200') {
                              layer.msg(response.msg);
                              location_reload(1000);
                          } else {
                              layer.msg(response.msg);
                              return false;
                          }
                      }
                  })
                return false;
              });
            });

            function location_reload(time)
            {
                setTimeout(function () {
                    window.location.href = "{:url('/manager')}";
                }, time)
            }
        })
    </script>
</body>
</html>